<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Resources\panyuan\GonggaoCollection;
use App\model\panyuan\Gonggao;
use Illuminate\Http\Request;

class GonggaoController extends Controller
{
    public function index(){
         $gonggao=    Gonggao::orderBy('id','desc')->paginate(10);
         return new GonggaoCollection($gonggao);
    }
    public function  detail($id){
         $gonggao=Gonggao::find($id);
         return response()->json(
             [
                 'code'=>'success',
                 'message'=>'请求成功',
                 'data'=>$gonggao
             ]
         );
    }
}
